<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="statics/css/orderOK.css" />
<script type="text/javascript" src="statics/js/jquery-1.12.4.js"
	charset="UTF-8"></script>
<script src="statics/layer/layer.js"></script>
<script type="text/javascript">
	$(function() {
		$(".payway .myWallet").click(function() {
			layer.open({
				type : 1,
				area : [ '300px', '200px' ],
				skin : 'layui-layer-rim',
				title : [ '余额支付', 'font-size:18px;' ],
				content : $("#rest")
			});
		});
		$("#rest button").click(function() {
			if (Number($(".umoney").text()) < Number($(".omoney").text())) {
				layer.alert("您当前余额不足！");
			} else {
				$.post("orderok", {
					omoney:$(".omoney").text(),
					ono:$(".orderNo").text()
				}, function(data) {
					if($.trim(data)=="true"){
						layer.msg("支付成功！");
						window.location.href ="user/order?orderstate=1";
					}else{
						layer.alert("支付失败！");
					}
				});

			}
		});
		//隐藏页眉菜单栏
		$(".ymb").hide();
	});
	    var time=new Date().getTime();
	    var newTime=time+3*60*60;
	    var addNDays= new Date(newTime);
		console.log(addNDays);
</script>
<title>下单成功</title>
</head>
<body>
	<jsp:include page="top.jsp"></jsp:include>
	<div class="out">
		<h1>恭喜你，下单成功~</h1>
		<h4>请在3小时内支付，否则订单将会取消。</h4>
		<p>订单号：<span class="orderNo">${param.ono }</span></p>
		<p>请选择支付方式：</p>
		<div class="payway">
			<img alt="我的钱包" src="statics/image/goods/qb.jpg" class="myWallet">
			<img alt="支付宝" src="statics/image/goods/zfb.jpg" class="zfb"> <img
				alt="微信" src="statics/image/goods/wx.jpg" class="wx">
		</div>
	</div>
	<div id="rest" data-id="${param.uid }">
		<p>
			当前余额：<span class="umoney">${user.umoney }</span>
		</p>
		<p>
			付款：<span class="omoney">${param.omoney }</span>元
		</p>
		<button>确认付款</button>
	</div>

</body>
</html>